﻿<Window x:Class="VfpReaderSchemaExample.Views.ShellView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
        xmlns:core="clr-namespace:VfpReaderSchemaExample"
        Title="{Binding DisplayText}"
        Height="{Binding Height, Mode=TwoWay}"
        Width="{Binding Width, Mode=TwoWay}"
        Left="{Binding Left, Mode=TwoWay}"
        Top="{Binding Top, Mode=TwoWay}"
        WindowState="{Binding WindowState, Mode=TwoWay}">
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Closing">
            <i:InvokeCommandAction Command="{Binding WindowClosing}" />
        </i:EventTrigger>
    </i:Interaction.Triggers>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <StackPanel Orientation="Horizontal" Grid.ColumnSpan="3">
            <Label Content="Table:" />
            <ComboBox ItemsSource="{Binding Path=Tables}"
                      SelectedItem="{Binding Path=SelectedTable, Mode=TwoWay}" 
                      HorizontalAlignment="Stretch" 
                      MinWidth="200" />
        </StackPanel>
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="5"  />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <GridSplitter Grid.Row="1"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Stretch" />
            <GroupBox Header="OleDb Schema">
                <DataGrid ItemsSource="{Binding OleDbSchema}" CanUserAddRows="False" />
            </GroupBox>
            <GroupBox Grid.Row="2" Grid.Column="2" Header="VfpClient Schema">
                <DataGrid ItemsSource="{Binding VfpSchema}" CanUserAddRows="False" />
            </GroupBox>
        </Grid>
    </Grid>
</Window>
